<template>
	<view class="index">
		<view class="tabs-wrapper">
			<v-tabs class="v-tab" bgColor="#ffffff" height="80upx" v-model="current" :tabs="tabList" :scroll="false"
				:bold="false" lineHeight="4upx" lineColor="#555BFF" activeColor="#555BFF" color="#79838A"
				fontSize="30upx"></v-tabs>
		</view>
		<view class="page-wrapper">
			<swiper class="swiper" :current="current" @change="changePage">
				<swiper-item class="swiper-item">
					<reject ref="reject" :code="code"></reject>
				</swiper-item>
				<swiper-item class="swiper-item">
					<printList :code="code"></printList>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script>
	import reject from '@/subPage_testing/reject'
	import printList from '@/subPage_testing/printList'

	export default {
		data() {
			return {
				tabList: ['质检登记', '打印供货单'],
				current: 0,
				code: ''
			}
		},
		onLoad(option) {
			this.code = option.code
		},
		methods: {
			changePage(e) {
				this.current = e.detail.current;
			},
			scanCode(code) {
				this.$refs.reject.scanCode(code);
			}
		},
		components: {
			reject,
			printList
		}
	}
</script>

<style lang="scss" scoped>
	.index {
		height: 100%;
		overflow: hidden;

		.tabs-wrapper {
			display: flex;
			align-items: center;
			background-color: #ffffff;
			margin-top: 2upx;

			.v-tab {
				flex: 1;
			}

			.date-wrapper {
				font-size: 30upx;
				margin-right: 20upx;
				color: #434343;
				display: flex;
				align-items: center;
				height: 30upx;
				border-left: 1upx solid #cecece;
				padding-left: 30upx;
				min-width: 180upx;
				text-align: center;

				.icon {
					font-weight: bold;
					margin-left: 5upx;
				}
			}
		}

		.swiper {
			height: calc(100vh - 86upx);

			.tip {
				color: #FF8D1A;
				background-color: #ffffff;
				border-radius: 20upx;
				padding: 20upx;
				font-size: 28upx;
			}

			.nodata-wrapper {
				text-align: center;
				font-size: 32upx;
				color: #666666;

				.nodata-image {
					margin-top: 300upx;
					margin-bottom: 10upx;
					width: 246upx;
				}

				.loading-image {
					margin-top: 300upx;
					margin-bottom: 10upx;
					width: 296upx;
					height: 205upx;
				}
			}
		}
	}
</style>